package com.zhijian.medical.dao.local;

import com.zhijian.medical.entity.po.ExamPaperPersonResult;
import com.zhijian.medical.entity.vo.request.ExamPaperPersonResultSearchVo;
import com.zhijian.medical.entity.vo.response.ExamPaperPersonResultVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ExamPaperPersonResultMapper {
    int deleteByPrimaryKey(Long id);

    int insert(ExamPaperPersonResult record);

    int insertSelective(ExamPaperPersonResult record);

    ExamPaperPersonResult selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ExamPaperPersonResult record);

    int updateByPrimaryKey(ExamPaperPersonResult record);

    int count(ExamPaperPersonResultSearchVo examPaperPersonResultSearchVo);

    List<ExamPaperPersonResultVo> selectList(ExamPaperPersonResultSearchVo examPaperPersonResultSearchVo);

    /**
     * 根据试卷id进行删除
     *
     * @param examPaperId
     * @return
     */
    boolean deleteByExamPaperId(Long examPaperId);

    /**
     * 查询一个人在一个试卷中答对题目的数量
     *
     * @param examPaperPersonId
     * @param userId
     * @return
     */
    Integer selectRightCountByExamPaperIdAndUserId(@Param("examPaperPersonId") Long examPaperPersonId, @Param("userId") Long userId);

}